﻿using System.Collections;
using System.Collections.Generic;
using Assets.Scripts.Game.AI;
using Assets.Scripts.Game.Event;


namespace Assets.Scripts.Game.GameObj
{
    public enum UnitLogic
    {
        Idle = 1,
        Run
    }


    public class Characater : Unit
    {

        public Characater()
        {
            _fsm = new StateMachine(this);
            CurObjType = ObjType.Characater;
            _command_list = new List<BaseEvent>();

        }



        //----------------------------------------------------------------------------------------------------

        /*
     初始化接口
     */
        public override void Init()
        {

        }

        /**
     释放接口
     */
        public override void Destory()
        {

        }





        private CharacaterData data;

        public CharacaterData GetCharacaterData()
        {
            return data;
        }

        public void InitCharacaterData()
        {

        }



        #region 指令相关

        /*
     * 有些指令需要立即执行 有些需要慢速执行
     */

        public override bool PushCommand(BaseEvent command)
        {


            return true;
        }

        /*
     模拟消息
     */
        protected bool SimCommand(BaseEvent command)
        {

            return true;
        }


        /**
     * 将指令放入指令队列 
     *
     */
        protected bool PushLogicCommand(BaseEvent command)
        {

            return true;
        }

        /**
     * 执行指令 
     */
        protected virtual void ProcessCommand()
        {

        }


        /***
     * 清理指令
     */
        protected void ClearCommand()
        {
            _command_list.Clear();
        }

        public float GetLogicSpeed() { return _logicSpeed; }
        public void SetLogicSpeed(float speed) { _logicSpeed = speed; }

        private List<BaseEvent> _command_list;
        private float _logicSpeed;


        #endregion



        #region AI相关



        private StateMachine _fsm;
        public StateMachine GetFsm()
        {
            return _fsm;
        }

        #endregion


        #region 渲染相关

        public virtual void CreateRenderInterface()
        {
            
        }

        public virtual void ReleaseRenderInterface()
        {
            
        }




        public virtual void OnAnimatorEnd()
        {
            
        }

        public virtual void OnAnimatorBreak()
        {
            
        }

        public virtual void OnAnimatorHit()
        {
            
        }
        #endregion




    }
}